from sqlalchemy import create_engine, MetaData, Table, Column, Integer, VARCHAR, DateTime, func
from sqlalchemy.dialects.mysql import TINYINT

# Assuming you have already defined the Table as in your example
user_metadata = MetaData()

users = Table(
    'users', user_metadata,
    Column('id', Integer, primary_key=True),
    Column('username', VARCHAR(20), nullable=False),
    Column('roles', VARCHAR(100)),
    Column('mobile', VARCHAR(20), nullable=False),
    Column('created_at', DateTime, nullable=False, default=func.now()),
    Column('deleted_at', DateTime),
    Column('password', VARCHAR(500), nullable=False, comment='$划分'),
    Column('updated_at', DateTime, default=func.now(), onupdate=func.now()),
    Column('gender', TINYINT, nullable=False, comment='0是女,1是男'),
    Column('birthday', DateTime)
)

# Get all columns
all_columns = users.columns
print(all_columns)
print(users.c.username)
# Print the column names
for column in all_columns:
    print(column.name)